/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.domain.bo;

import com.comac.ins.common.core.validate.AddGroup;
import com.comac.ins.common.core.validate.EditGroup;
import com.comac.ins.common.mybatis.core.domain.BaseEntity;
import com.comac.ins.isfd.domain.IsfdDatasourceTaskFieldMapping;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 数据源数据集成任务字段映射业务对象 isfd_datasource_task_field_mapping
 *
 * @author Lion Li
 * @date 2024-10-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = IsfdDatasourceTaskFieldMapping.class, reverseConvertGenerate = false)
public class IsfdDatasourceTaskFieldMappingBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 目标配置ID，关联target_config表
     */
    @NotNull(message = "目标配置ID，关联target_config表不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long targetId;

    /**
     * 源表字段
     */
    @NotBlank(message = "源表字段不能为空", groups = {AddGroup.class, EditGroup.class})
    private String sourceField;

    /**
     * 源表字段所属表名/集合名
     */
    @NotBlank(message = "源表字段所属表名/集合名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String sourceTableName;

    /**
     * 目标字段
     */
    @NotBlank(message = "目标字段不能为空", groups = {AddGroup.class, EditGroup.class})
    private String targetField;

    /**
     * 目标字段所属表名/集合名
     */
    @NotBlank(message = "目标字段所属表名/集合名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String targetTableName;

    /**
     * 字段类型（例如Long、String等）
     */
    @NotBlank(message = "字段类型（例如Long、String等）不能为空", groups = {AddGroup.class, EditGroup.class})
    private String fieldType;

    /**
     * 字段长度
     */
    @NotNull(message = "字段长度不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long fieldLength;

    /**
     * 是否删除，0-未删除，1-已删除
     */
    @NotNull(message = "是否删除，0-未删除，1-已删除不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer isDeleted;


}
